# coding:utf-8

'''GUI'''

from Tkinter import *
import tkMessageBox

class Application(Frame):
    
    def __init__(self,master=None):
        Frame.__init__(self, master)
        self.pack()
        self.createWidget()
        
    def createWidget(self):
        self.helloLabel=Label(self,text="Hello world")
        self.helloLabel.pack()
        self.btn=Button(self,text="退出",command=self.quit)
        self.btn.pack()
        self.helloBtn=Button(self,text='say hello',command=self.say('tzj'))
        self.helloBtn.pack()
        
    def say(self,message):
        tkMessageBox.showinfo('I am Title', 'hello %s' % message)
        
app=Application()
# 设置窗口标题:
app.master.title('My Title')
# 主消息循环:
app.mainloop()